<?php

require_once("LoginView.php");
require_once("RegisterView.php");
require_once("UserPageView.php");

class ApplicationView {
	
	/**
	 * @var NavigationView
	 */
	private $navView;
	/**
	 * @var LoginView
	 */
	private $loginView;
	/**
	 * @var RegisterView
	 */
	private $regView;
	/**
	 * @var UserPageView
	 */
	private $userPageView;
	
	/**
	 * @param NavigationView $navView
	 */
	public function __construct(NavigationView $navView) {
		$this->navView = $navView;
	}
	
	/**
	 * @param string $content HTML
	 * @return string HTML
	 */
	public function getLoginHTML($content) {
		$str = "<article>
		    		<a href='?". $this->navView->getRegisterURL() ."'>Register user</a>
					<h2>Not logged in</h2>
					$content
		    	</article>";
			   
		return $str;
	}
	
	/**
	 * @param string $content HTML
	 * @return string HTML
	 */
	public function getRegisterHTML($content) {
		$str = "<article>
		    		<a href='?'>Back</a>
					<h2>Register user</h2>
					$content
		    	</article>";
			   
		return $str;
	}
	
	/**
	 * @param User $user
	 * @param string $content HTML
	 * @param string $dropBox HTML
	 * @var string $str HTML
	 * @return string HTML
	 */
	public function getHeaderHTML($user, $content, $dropBox) {
		$str = "<section id='MainHeader'>
					<img src='images/".$user->getPicture()."'></img>
					<p>Logged in as <a href='?".$this->navView->getUsernameURL()."=".$user->getUsername()."'>".$user->getUsername()."</a></p>
					<p>Users: </p>$dropBox
					$content
				</section>";
			   
		return $str;
	}
	
	/**
	 * @param string $content HTML
	 * @return string HTML
	 */
	public function getUserPageHTML($content) {
		return $content;
	}
}
